package com.miao.test.common.enums;

/**
 * @Auther: miaoguoxin
 * @Date: 2021/2/25 17:29
 * @Description:
 */
public enum DeviceType {
    WEB(1,"网页"),
    ANDROID(2,"安卓"),
    IOS(3,"ios")
    ;

    private int code;

    private String value;

    DeviceType(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static DeviceType getByCode(int code) {
        for (DeviceType e : DeviceType.values()) {
            if (e.getCode() == code) {
                return e;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }
}
